const config = require('./webpack.common.js')
const merge = require('webpack-merge')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')

const webpackConfig = merge(config, {
  mode: 'production',
  devtool: 'cheap-module-eval-source-map',
  optimization: {

  },
  plugins: [],
  stats: 'errors-only'
})

if (process.env.npm_config_report) {
  webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}

module.exports = webpackConfig
